class Message<T>{
    private T message;
    public T getMessage(){
        return message;
    }
    public void setMessage(T message){
        this.message=message;
    }
}

public class test2 {
    public static void main(String[] args) {
        Message<String> message=new Message<>();
        message.setMessage("hehe");
        fun(message);

        Message<Integer> message1=new Message<>();
        message1.setMessage(10);
        fun(message1);
    }

    public static void fun(Message<?> tmp){
        //类型不确定无法设置，无法修改
        //tmp.setMessage(12);
        System.out.println(tmp.getMessage());
    }

}



